//
//  AppDelegate.swift
//  Landmarks
//
//  Created by XN on 2019/6/4.
//  Copyright © 2019 pc. All rights reserved.
//

import UIKit
import SwiftUI

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
    
    
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.
        
        let _rv = LandmarkList().environment(ModelData())
        self.window?.rootViewController = UIHostingController.init(rootView:_rv)
        
        return true
    }
    
    func applicationWillTerminate(_ application: UIApplication) {
        // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
    }
    
    //MARK: - lazy load
    internal lazy var window: UIWindow? = {
        let _window = UIWindow.init(frame: UIScreen.main.bounds)
        _window.tintColor = .black
        _window.backgroundColor = .white
        _window.makeKeyAndVisible()
        _window.makeKey()
        
        return _window
    }()
    
    private lazy var helloRV = {
        return UIHostingController.init(rootView: FirstView.init())
    }()
    
}

